<div class="row">
	<div class="col-lg-offset-2 col-lg-5">
		<%= form_for @case do |f| %>
			<div class="form-group">
				<label class="control-label">Case Name</label>
				<%= f.text_field :name, class: "form-control" %>
				<% if @case.errors[:name].present? %>
                	<div class="error-message"><%=  @case.errors[:name][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Owner</label>
				<%= f.collection_select :owner, User.all, :id, :email, {prompt: true}, class: "form-control" %>
				<% if @case.errors[:owner].present? %>
                	<div class="error-message"><%=  @case.errors[:owner][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Case Status</label>
				<%= f.collection_select :case_status_id, CaseStatus.all, :id, :name, {prompt: true}, class: "form-control", include_prompt: true %>
				<% if @case.errors[:case_status_id].present? %>
                	<div class="error-message"><%=  @case.errors[:case_status_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Case Type</label>
				<%= f.collection_select :case_type_id, CaseType.all, :id, :name, {prompt: true}, class: "form-control", include_prompt: true %>
				<% if @case.errors[:case_type_id].present? %>
                	<div class="error-message"><%=  @case.errors[:case_type_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Case Origin</label>
				<%= f.collection_select :case_origin_id, CaseOrigin.all, :id, :name, {prompt: true}, class: "form-control", include_prompt: true %>
				<% if @case.errors[:case_origin_id].present? %>
                	<div class="error-message"><%=  @case.errors[:case_origin_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Case Reason</label>
				<%= f.collection_select :case_reason_id, CaseReason.all, :id, :name, {prompt: true}, class: "form-control", include_prompt: true %>
				<% if @case.errors[:case_reason_id].present? %>
                	<div class="error-message"><%=  @case.errors[:case_reason_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Priority</label>
				<%= f.collection_select :priority_id, Priority.all, :id, :name, {prompt: true}, class: "form-control" %>
				<% if @case.errors[:priority_id].present? %>
                	<div class="error-message"><%=  @case.errors[:priority_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Related To</label>
				<%= f.text_field :contact_id, class: "form-control" %>
				<% if @case.errors[:contact_id].present? %>
                	<div class="error-message"><%=  @case.errors[:contact_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Product</label>
				<%= f.text_field :product_id, class: "form-control" %>
				<% if @case.errors[:product_id].present? %>
                	<div class="error-message"><%=  @case.errors[:product_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Account</label>
				<%= f.text_field :account_id, class: "form-control" %>
				<% if @case.errors[:account_id].present? %>
                	<div class="error-message"><%=  @case.errors[:account_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Reported By</label>
				<%= f.text_field :reported_by, class: "form-control" %>
				<% if @case.errors[:reported_by].present? %>
                	<div class="error-message"><%=  @case.errors[:reported_by][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Comments</label>
				<%= f.text_area :comments, class: "form-control" %>
				<% if @case.errors[:comments].present? %>
                	<div class="error-message"><%=  @case.errors[:comments][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Phone</label>
				<%= f.phone_field :phone, class: "form-control" %>
				<% if @case.errors[:phone].present? %>
                	<div class="error-message"><%=  @case.errors[:phone][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Email</label>
				<%= f.email_field :email, class: "form-control" %>
				<% if @case.errors[:email].present? %>
                	<div class="error-message"><%=  @case.errors[:email][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<%= f.submit "Save", class: "btn btn-warning" %>
				<%= link_to "Back", cases_path , class: "btn btn-primary" %>
			</div>
		<% end %>
	</div>
</div>